<?php

namespace app\model;
use app\utils\UserMoneyEmun;
use think\model\concern\SoftDelete;
class UserMoney extends BaseModel
{
    use SoftDelete;
    protected $deleteTime = 'delete_at';
    protected $table = 'user_money';

    public function member(){
        return $this->belongsTo(Member::class, 'member_id', 'id');
    }

    public function getTypeTextAttr($value, $data)
    {
        return UserMoneyEmun::userMoneyTypeText($data['type']);
    }
}
